package string;

public class IndexOFDemo {
    public static void main(String[] args) {
        /**
         * 给一个字符串找位置
         */
        String str = "I like Java,Java is a very good subject";
        int index = str.indexOf("Java");
        System.out.println(index);
        index=str.lastIndexOf("Java");
        System.out.println(index);
    }
}
